package com.bsoft.gol.editor.fileUpload;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 表格数据
 * @author 王智伟
 *
 */
public class TableData<T> {
	
	private AtomicInteger count = new AtomicInteger(0);//数据记录总数
	private AtomicInteger invalidCount = new AtomicInteger(0);//未通过验证的数据记录总数
	public void setInvalidCount(AtomicInteger invalidCount) {
		this.invalidCount = invalidCount;
	}

	private StringBuffer invalidMsg = new StringBuffer();//未通过验证的描述
	
	private List<T> rowData = new ArrayList<T>();//表格中的数据集合
	
	public void setRowData(List<T> rowData) {
		this.rowData = rowData;
	}

	public void addRowDataItem(T rowDataItem){
		rowData.add(rowDataItem);
		count.getAndIncrement();
	}
	
	public AtomicInteger getCount() {
		return count;
	}
	public AtomicInteger getInvalidCount() {
		return invalidCount;
	}
	public void addInvalidCount() {
		this.invalidCount.getAndIncrement();
	}
	public List<T> getRowData() {
		return rowData;
	}

	public StringBuffer getInvalidMsg() {
		return invalidMsg;
	}

	public void setInvalidMsg(StringBuffer invalidMsg) {
		this.invalidMsg = invalidMsg;
	}
}
